package com.jy.borrow.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jy.common.annotation.Excel;
import com.jy.common.core.domain.BaseEntity;

/**
 * 图书借阅记录对象 borrow
 * 
 * @author ruoyi
 * @date 2025-05-29
 */
public class Borrow extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 借阅ID，主键，自增 */
    private Long id;

    /** 图书ID，关联 books 表 */
    @Excel(name = "图书ID，关联 books 表")
    private Long bookId;

    /** 借阅人ID，关联 users 表 */
    @Excel(name = "借阅人ID，关联 users 表")
    private Long borrowerId;

    /** 借阅日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "借阅日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date borrowDate;

    /** 归还日期（为空表示未归还） */
    @Excel(name = "归还日期", readConverterExp = "为=空表示未归还")
    private Date returnDate;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setBookId(Long bookId) 
    {
        this.bookId = bookId;
    }

    public Long getBookId() 
    {
        return bookId;
    }

    public void setBorrowerId(Long borrowerId) 
    {
        this.borrowerId = borrowerId;
    }

    public Long getBorrowerId() 
    {
        return borrowerId;
    }

    public void setBorrowDate(Date borrowDate) 
    {
        this.borrowDate = borrowDate;
    }

    public Date getBorrowDate() 
    {
        return borrowDate;
    }

    public void setReturnDate(Date returnDate) 
    {
        this.returnDate = returnDate;
    }

    public Date getReturnDate() 
    {
        return returnDate;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("bookId", getBookId())
            .append("borrowerId", getBorrowerId())
            .append("borrowDate", getBorrowDate())
            .append("returnDate", getReturnDate())
            .toString();
    }
}
